package com.ellwood.IPGuard.common.core.enums;

import lombok.Getter;

/**
 * @ProjectName: IPGuard-boot
 * @PackageName: com.ellwood.IPGuard.common.core.enums
 * @ClassName: HttpCodeEnum
 * @Description: // 返回状态消息
 * @Author: Ellwood
 * @CreateDate: 2024/9/30 - 上午10:37
 * @Version: V1.0.0
 */
@Getter
public enum HttpCodeEnum {
        
        // 成功
        SUCCESS(200, "操作成功"),
        ERROR(400, "请求失败"),
        
        // 登录
        NEED_LOGIN(401, "请先登录"),
        NO_OPERATOR_AUTH(403, "无权限操作"),
        QUERY_DATA_NULL(404, "查询数据为空"),
        QUERY_DATA_NOT_EXIST(405, "查询数据不存在"),
        
        SYSTEM_ERROR(500, "出现错误"),
        SYSTEM_TIMEOUT(501, "系统超时"),
        SERVICE_ERROR(502, "服务异常"),
        SERVICE_UNAVAILABLE(503, "服务不可用"),
        BAD_REQUEST(504, "请求参数错误"),
        
        USERNAME_EXIST(1001, "用户名已存在"),
        MOBILE_NUMBER_EXIST(1002, "手机号已存在"),
        MOBILE_NUMBER_NOT_NULL(1003, "手机号不能为空"),
        EMAIL_EXIST(1004, "邮箱已存在"),
        REQUIRE_USERNAME(1005, "必需填写用户名"),
        USERNAME_NOT_NULL(1006, "用户名不能为空"),
        PASSWORD_NOT_NULL(1007, "密码不能为空"),
        EMAIL_NOT_NULL(1008, "邮箱不能为空"),
        ;
        
        private Integer code;
        private String msg;
        
        HttpCodeEnum(Integer code, String msg) {
                this.code = code;
                this.msg = msg;
        }
        
}
